/*
 * @lc app=leetcode.cn id=485 lang=java
 *
 * [485] 最大连续1的个数
 */

// @lc code=start
class Solution {
    public int findMaxConsecutiveOnes(int[] nums) {
        int sum = 0,temp = 0;
        for(int i =0 ;i<nums.length ;i++){
            if(nums[i] == 1) temp++;
            else {
                if(sum < temp) sum = temp;
                temp = 0;
            }
        }
        if(temp > sum) sum = temp;
        return sum;
    }
}
// @lc code=end

